class Node<T>{
    public T val;
    public Node<T> next;
    public Node<T> prev;
    public Node(){
        this.val = null;
        this.next = null;
    }
    public Node(T val){
        this();
        this.val = val;
    }
    public Node(T val, Node<T> next){
        this.val = val;
        this.next = next;
    }
    public Node(T val, Node<T> prev, Node<T> next){
        this.val = val;
        this.prev = prev;
        this.next = next;
    }
    @Override
    public String toString() {
        return this.val.toString();
    }
}